package code.snippet.demo

import code.snippet.{LiftComponentSnippet, RenderSnippet}
import scala.xml.NodeSeq
import bs._
import Button._
import bs.DropdownMenu
import bs.Link
import bs.SplitButtonDropdown
import bs.SplitButtonDropup
import bs.Dropdown

object ButtonDemo extends LiftComponentSnippet[Button]{
  override val component = Button("按钮").success.leftWhiteIcon("search")
}

object ButtonDropdownDemo extends LiftComponentSnippet[ButtonDropdown] {
  override val component  = ButtonDropdown("菜单", DropdownMenu(
    Link("链接", "/"),
    Divider,
    Dropdown("子菜单", DropdownMenu(
      Link("子链接", "/")
    )))).danger.large

}

object ButtonDropupDemo extends LiftComponentSnippet[ButtonDropup] {
  override val component  = ButtonDropup("菜单", DropdownMenu(
    Link("链接", "/"),
    Divider,
    Dropdown("子菜单", DropdownMenu(
      Link("子链接", "/")
    )))).success

}

object SplitButtonDropupDemo extends LiftComponentSnippet[SplitButtonDropup] {
  override val component  = SplitButtonDropup("菜单", DropdownMenu(
    Link("链接", "/"),
    Divider,
    Dropdown("子菜单", DropdownMenu(
      Link("子链接", "/")
    )))).inverse.mini
}

object SplitButtonDropdownDemo extends LiftComponentSnippet[SplitButtonDropdown] {
  override val component  = SplitButtonDropdown("菜单", DropdownMenu(
    Link("链接", "/"),
    Divider,
    Dropdown("子菜单", DropdownMenu(
      Link("子链接", "/")
    )))).info.small

}

object ButtonToolbarDemo extends LiftComponentSnippet[ButtonToolbar] {

  val component = ButtonToolbar(
    ButtonGroup(List(1, 2, 3, 4).map(_.toString).map(Button.apply):_*),
    ButtonGroup(List(5, 6, 7).map(_.toString).map(Button.apply):_*),
    ButtonGroup(List(8).map(_.toString).map(Button.apply):_*)
  )
}

object ButtonGroupDemo extends LiftComponentSnippet[ButtonGroup] {
  override val component = ButtonGroup(
    Button("Left"), Button("Center"), Button("Right")
  )
}
object VerticalButtonGroupDemo extends LiftComponentSnippet[ButtonGroup] {

  override val component =
    ButtonGroup(List("align-left", "align-center", "align-right", "align-justify").map(icon => Button("").leftIcon(icon)):_*).vertical
}


